package com.huawei.appmarket.service.store.awk.card;

import android.content.Context;
import android.view.View;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appmarket.service.store.awk.bean.ContentItemBean;
import com.huawei.appmarket.service.store.awk.bean.ContentMidCardBean;
import o.cgz;

public class ContentMidCard extends ContentCard {
    private TitleExtCard ˋ = null;

    public ContentMidCard(Context context) {
        super(context);
    }

    public TitleExtCard ˋ() {
        return this.ˋ;
    }

    public void ˊ(TitleExtCard titleExtCard) {
        this.ˋ = titleExtCard;
    }

    public cgz ˏ(View view) {
        ʽ(view);
        return this;
    }

    public void ˏ(CardBean cardBean) {
        int size;
        ContentMidItemCard contentMidItemCard;
        cardBean = (ContentMidCardBean) cardBean;
        if (this.ˋ != null) {
            this.ˋ.ˏ(cardBean);
        }
        if (cardBean.ॱ() != null) {
            size = cardBean.ॱ().size();
        } else {
            size = 0;
        }
        for (int i = 0; i < ˎ(); i++) {
            contentMidItemCard = (ContentMidItemCard) ˋ(i);
            if (contentMidItemCard != null) {
                if (i >= size) {
                    contentMidItemCard.ˉ().setVisibility(8);
                } else {
                    contentMidItemCard.ˉ().setVisibility(0);
                    CardBean cardBean2 = (ContentItemBean) cardBean.ॱ().get(i);
                    cardBean2.ˋˋ(cardBean.ॱˉ());
                    contentMidItemCard.ˏ(cardBean2);
                }
            }
        }
        contentMidItemCard = (ContentMidItemCard) ˋ(size - 1);
        if (contentMidItemCard != null) {
            contentMidItemCard.ˎ().setVisibility(8);
        }
    }
}
